package _16define;

public class Demo2 implements Cloneable{
    int num;

    public Demo2(int num) {
        this.num = num;
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        Dog dog=new Dog("大黄","黄色");
        Demo2 demo2 = new Demo2(100);
        Object clone=demo2.clone();
        System.out.println(demo2);
        System.out.println(clone);

        System.out.println(((Demo2) clone).num);

    }
}
class Dog{
    String name;
    String color;

    public Dog(String name, String color) {
        this.name = name;
        this.color = color;
    }
}
class Father{
    void m1(){

    }
}
class Son extends Father{
    public void m1(){

    }
}